package com.ahsjdy.stcommon.dto;


import java.io.Serializable;

public class ResponseDTO implements Serializable {

    private Object data;

    private int code = 1000;

    private String message;

    private ResponseDTO() {

    }

    private ResponseDTO(int code, String message, Object data) {
        this.message = message;
        this.data = data;
        this.code = code;
    }

    public static ResponseDTO success() {
        return new ResponseDTO(1000, null, null);
    }

    public static ResponseDTO success(Object data) {
        return new ResponseDTO(1000, null, data);
    }

    public static ResponseDTO failed(String message) {
        return new ResponseDTO(9999, message, null);
    }

    public static ResponseDTO login(String message) {
        return new ResponseDTO(5000, message, null);
    }

    public Object getData() {
        return data;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
